package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_attribute", schema = "", catalog = "onedollar")
public class TAttributeEntity {
    private int attrId;
    private Integer catId;
    private String attrName;
    private String attrValues;
    private Integer sortOrder;
    private Integer isLinked;
    private Integer attrGroup;
    private Timestamp addTime;
    private Timestamp updateTime;
    private Integer status;

    @Id
    @Column(name = "attr_id", nullable = false, insertable = true, updatable = true)
    public int getAttrId() {
        return attrId;
    }

    public void setAttrId(int attrId) {
        this.attrId = attrId;
    }

    @Basic
    @Column(name = "cat_id", nullable = true, insertable = true, updatable = true)
    public Integer getCatId() {
        return catId;
    }

    public void setCatId(Integer catId) {
        this.catId = catId;
    }

    @Basic
    @Column(name = "attr_name", nullable = true, insertable = true, updatable = true, length = 50)
    public String getAttrName() {
        return attrName;
    }

    public void setAttrName(String attrName) {
        this.attrName = attrName;
    }

    @Basic
    @Column(name = "attr_values", nullable = true, insertable = true, updatable = true, length = 100)
    public String getAttrValues() {
        return attrValues;
    }

    public void setAttrValues(String attrValues) {
        this.attrValues = attrValues;
    }

    @Basic
    @Column(name = "sort_order", nullable = true, insertable = true, updatable = true)
    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    @Basic
    @Column(name = "is_linked", nullable = true, insertable = true, updatable = true)
    public Integer getIsLinked() {
        return isLinked;
    }

    public void setIsLinked(Integer isLinked) {
        this.isLinked = isLinked;
    }

    @Basic
    @Column(name = "attr_group", nullable = true, insertable = true, updatable = true)
    public Integer getAttrGroup() {
        return attrGroup;
    }

    public void setAttrGroup(Integer attrGroup) {
        this.attrGroup = attrGroup;
    }

    @Basic
    @Column(name = "add_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "update_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TAttributeEntity that = (TAttributeEntity) o;

        if (attrId != that.attrId) return false;
        if (catId != null ? !catId.equals(that.catId) : that.catId != null) return false;
        if (attrName != null ? !attrName.equals(that.attrName) : that.attrName != null) return false;
        if (attrValues != null ? !attrValues.equals(that.attrValues) : that.attrValues != null) return false;
        if (sortOrder != null ? !sortOrder.equals(that.sortOrder) : that.sortOrder != null) return false;
        if (isLinked != null ? !isLinked.equals(that.isLinked) : that.isLinked != null) return false;
        if (attrGroup != null ? !attrGroup.equals(that.attrGroup) : that.attrGroup != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = attrId;
        result = 31 * result + (catId != null ? catId.hashCode() : 0);
        result = 31 * result + (attrName != null ? attrName.hashCode() : 0);
        result = 31 * result + (attrValues != null ? attrValues.hashCode() : 0);
        result = 31 * result + (sortOrder != null ? sortOrder.hashCode() : 0);
        result = 31 * result + (isLinked != null ? isLinked.hashCode() : 0);
        result = 31 * result + (attrGroup != null ? attrGroup.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }
}
